<?php

	include_once("./db.php"); 
	
	$userId = $_SESSION["user"]["Id"];

	$res = db_select("SELECT 
		t.Name 
		FROM
			Mode m,
			UserMode um
		WHERE
			t.Id = tu.ModeId AND
			tu.UserId = $userId
			ORDER BY t.Name");

	while($item = mysql_fetch_array($res, MYSQL_ASSOC))
		$ret["Tags"][] = $item["Name"];
	
	echo json_encode($ret);

?>

